package com.aztec.ims.service.dao;

import java.util.List;

import com.aztec.ims.domain.TaxScheme;
import com.aztec.ims.service.response.GenericResponse;

public class TestTaxSchemeDao {
	public static void main(String[] args) {

		//save();
		get();
	}

	private static void save() {
		TaxSchemeDao dao = new TaxSchemeDao();

		TaxScheme request = new TaxScheme();
        request.setTaxschemeName("income tax scheme");
        request.setActiveFlag(Boolean.TRUE);
        request.setCompoundFlag(Boolean.FALSE);
        request.setPrimTaxName("prim tax name");
        request.setPrimTaxRate(new Float(1.1));
        request.setSecTaxName("sec tax name");
        request.setSecTaxRate(new Float(1.2));
        request.setTaxShipFlag(null);
		GenericResponse response = dao.createTaxScheme(request);
		System.out.println("*****Tax scheme id generated:" + response.getId()
				+ "******");
	}

	private static void get() {
		TaxSchemeDao dao = new TaxSchemeDao();
		List list = dao.getTaxSchemes();
		for(int i=0;i<list.size();i++){
			TaxScheme info = (TaxScheme)list.get(i);
			System.out.println("***" + i + ": " + info.getTaxschemeId()
					+ " **name: " + info.getTaxschemeName() + " ** primname:"
					+ info.getPrimTaxName()+ " ** primrate:" + info.getPrimTaxRate()
					+ " ** secname:" + info.getSecTaxName() + " ** secrate:"
					+ info.getSecTaxRate() + " ** active:" + info.getActiveFlag()
					+ " ** cmpd:" + info.getCompoundFlag() + " ** ship:"
					+ info.getTaxShipFlag());
		}
	}

}
